package com.thinkgem.jeesite.modules.sys.service;

import com.thinkgem.jeesite.modules.sys.dao.*;
import com.thinkgem.jeesite.modules.sys.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 处理业务
 * 
 * @author Zhang wenmeng
 * 
 */
@Service
public class PC {

	@Autowired
	ProvincesMapper dao;

	@Autowired
	CitysMapper dao1;

	@Autowired
	AreasMapper dao2;
	@Autowired
	UserDao userDao;
	@Autowired
	TbCommunityMapper tbCommunityMapper;
	// 查询出所有的省份
	@Transactional(readOnly = true)
	public List<Provinces> showProvinceList() {

		return dao.showProvinceList();
	}

	// 根据省id来查询所对应的城市名称
	@Transactional(readOnly = true)
	public List<Citys> showCityListByPid(int pid) {
		return dao1.showCityListByPid(pid);
	}

	// 根据city的id来查询所有的区、县
	@Transactional(readOnly = true)
	public List<Areas> showAreaListBycid(int cid) {
		return dao2.showAreaListBycid(cid);
	}

	public List<User> showAgentListByCityId(String citysId) {

		return userDao.showAgentListByCityId(citysId);
	}

	public List<TbCommunity> showCommunityListByAreaId(String areasId) {
		return userDao.showCommunityListByAreaId(areasId);
	}
}
